﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace MvcShop.Models
{
    [MetadataType(typeof(MetadataOnlinePoll))]
    public partial class OnlinePoll
    {
    }

    public class MetadataOnlinePoll
    {
        [Required(ErrorMessage = "调查主题不能为空。")]
        [StringLength(50, ErrorMessage = "调查主题不能超过50位。")]
        [DisplayName("调查主题")]
        public string Subject { get; set; }

        [Required(ErrorMessage = "图类型。")]
        [StringLength(50, ErrorMessage = "图类型不能超过10位。")]
        [DisplayName("图类型")]
        public string Charttype { get; set; }

        [Required(ErrorMessage = "问题类型不能为空。")]
        [StringLength(50, ErrorMessage = "问题类型不能超过10位。")]
        [DisplayName("问题类型")]
        public string Selectmode { get; set; }
    }
    

    [MetadataType(typeof(MetadataPollOption))]
    public partial class PollOption
    {
    }

    public class MetadataPollOption
    {
        [Required(ErrorMessage = "调查主题不能为空。")]
        [DisplayName("调查主题ID")]
        public int OId { get; set; }

        [Required(ErrorMessage = "具体选项文本不能为空。")]
        [StringLength(50, ErrorMessage = "具体选项文本不能超过50位。")]
        [DisplayName("具体选项文本")]
        public string Options { get; set; }

        [Required(ErrorMessage = "颜色不能为空。")]
        [StringLength(6, ErrorMessage = "颜色不能超过6位。")]
        [DisplayName("颜色")]
        public string Color { get; set; }

        [DisplayName("选票数")]
        public int Ballots { get; set; }
    }
}
